<style>
    .top-bar
{
    border: solid 2px red;
    position: fixed;
    width: 100%;
    background-color: aliceblue;
}
.top-bar > .head-link-btn
{
    background-color: #231557;
    border: solid 2px #231557;
    width: fit-content;
    display: inline;
}
.top-bar > .head-link-btn > a
{
    text-decoration: none;
    color: white;
}
.top-bar > .search-bar
{
    background-color: ;
}
.top-bar > .search
{
    background-color: red;
}
.top-bar > .upload
{
    background-color: yellow;
}
.top-bar > .login
{
    background-color: green;
}
.top-bar > .register
{
    background-color: blue;
}
</style>
<nav class="top-bar">
    <h1 class="head-link-btn"><a href="index.html">idea-show</a></h1>
    <input class="search-bar" type="text" placeholder="请输入搜索内容">
    <button class="search">搜索</button>
    <button class="upload">投稿</button>
    <button class="login">登录</button>
    <button class="register">注册</button>
</nav>